package com.app.service;

import com.app.model.AdminUserModel;
import com.app.model.BusinessModel;
import com.app.vo.ActivityVo;
import com.app.vo.BusinessDataVo;
import com.app.vo.BusinessVo;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * 商家信息
 *
 * @author 16693103420
 * @since 2024-01-22
 */
public interface BusinessService extends IService<BusinessModel> {
    //查询商家列表
    BusinessVo getBusinessList(AdminUserModel user, Integer page, Integer limit, String keywords, Integer areaId, Integer status);

    //用户查询商家列表
    BusinessVo getUserBusinessList(Integer page, Integer limit, String businessName, String areaId, Integer type, Double longitude, Double latitude, Integer sort, Integer classification, HttpServletRequest request);

    //用户查询商家详情
    BusinessModel getUserById(Integer id, Double longitude, Double latitude,  HttpServletRequest request);

    //甄选商家活动列表
    BusinessVo getTranslateActivityList(Integer page, Integer limit, Double longitude, Double latitude, String businessName, Integer areaId);


    //活动列表顶部的甄选
    ActivityVo getIsPickActivityList(Integer page,
                                     Integer limit,
                                     Integer classification,
                                     String activityName,
                                     Integer type,
                                     Integer sort,Double latitude,Double longitude);

    //商家经营数据
    BusinessDataVo getBusinessData(Integer userId);


    BusinessModel getByUserPhone(String phone);

    /**
     * 访问业务数据
     *
     * @param userId 用户id
     * @return {@link Map}<{@link String},{@link Object}>
     */
    Map<String, Integer> accessToBusinessData(Integer userId);

    Map<String, Integer> selectCount(Integer userId);

    void businessGrant(Integer id, Double voucherAmount, Double integral);

    /**
     * 判断该商家是否已入住
     *
     * @param userphone 绑定入驻表和管理表的唯一字段
     * @return
     */
    BusinessModel getBusinessByUserPhone(String userphone);

    /**
     * 根据BusinessIds查询商家信息
     *
     * @param list
     * @return
     */
    List<BusinessModel> selectbusinessList(List<Integer> list);

    BusinessVo getAllBusinessList(Integer page, Integer limit, String businessName, String areaId, Integer type, Double longitude, Double latitude, Integer sort, Integer classification, HttpServletRequest request);

    BusinessVo queryAndSelectMerchants(Integer page, Integer limit, Double longitude, Double latitude, String businessName, Integer areaId,Integer sort,Integer type);
}
